from lsptrain.nlp_similarity_predictor import TextSimilarityPredictor

string1 = "今天天气很好啊"
string2 = "今天天气真不错呢"

predictor = TextSimilarityPredictor(pretrained_tokenizer="hfl/chinese-roberta-wwm-ext")

result = predictor.predict(string1, string2)
print(result)

# 0.9285515402978386

string3 = "我开心"
string4 = "我不开心"

result = predictor.predict(string3, string4)
print(result)

# 0.8846080193868797
